.tn-tc{class: field}
  .input-block
    %label.input-block__explanation
      - if defined?(lang)
        = field.gsub("_#{lang}", '').to_s.titleize
        (#{lang_title})
      - else
        = field.to_s.titleize

    .tn-tc__wrap
      .tn-tc__rows
        = f.fields_for "#{field}_tenon_content_rows" do |row|
          - if row.object
            = render "tenon/tenon_content/row", f: row, row_partial: row.object.decorate.form_partial, field: field, title: row.object.row_type.titleize

      %div{style: 'display: none'}
        .modal{ data: { tn_tc_library: true } }
          .modal__content
            %ul.tn-tc-library__list
              - Tenon::TenonContent::RowTypes::LIBRARY_ROW_TYPES.each do |title, row_type|
                %li.tn-tc-library__item= row_link(title, row_type, field, f)


    %p
      = link_to 'Add Content', '#', class: 'action-text initial-row', data: { modal_target: '[data-tn-tc-library]', modal_closest: '.tn-tc', modal_clone: 'true', modal_handler: 'TenonContentLibrary', tn_tc_add_content: true }, title: 'Add Content'
